<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <title>编辑文章</title>
    <hdjs/>
    <bootstrap/>
    <css file="__CONTROL_TPL__/css/css.css"/>
    <js file="__PUBLIC__/yz.js"/>
    <style type="text/css">
        .checkbox{
             margin-left:5px;
             width:90px;
             margin-top: 10px;
        }
        textarea{
            width: 300px;
            height: 100px;
        }
        .slt{ position: relative; width: 200px;}
        .slt span{ position: absolute; top: 5px; right: 5px; display: block; background:#F00; width:15px; height: 15px; text-align: center;}

    </style>
    <script type="text/javascript">
        $(function(){
            var src = $('.shanchu').attr('src');
            var aid = $('.shanchu').attr('aid');

           $('.close').click(function(){
                $.ajax({
                    url : '__CONTROL__' + '/del_img',
                    type : 'post',
                    data : {'is_del' : src,'aid' : aid},
                    dataType : 'text',
                    success:function(data){
                        if (data) {
                            $('.slt').css({display:'none'});
                            alert('删除成功');
                        };
                    },
                    erroe:function(){
                        alert('error');
                    }
                })
           })
        })
    </script>
</head>
<body>
<div class="wrap">
    <div class="title-header">编辑文章</div>
    <form action="" method="post" class="form-inline hd-form" enctype="multipart/form-data">
        <table class="table1">
            <tr>
                <th class="w100">文章标题</th>
                <td class="w100">
                    <input type="text" name="title" class="w200" value="{$oldArc.title}"/> 
                    <span id="hd_title"></span>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">作者</th>
                <td>
                    <input type="text" name="author" class="w200" value="{$hd.session.adminname}"/>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">所属分类</th>
                <td>
                    <select name="category_cid" class="w200">
                        <option value="-1">请选择分类</option>
                        <foreach from="$cate" value="$v">
                            <option value="{$v.cid}" <if value="$v['cid'] eq $oldArc['category_cid']">selected="selected"</if>>{$v._name}</option>
                        </foreach>
                    </select>
                </td>
                <td><span id="ha_category_cid"></span></td>
            </tr>
            <tr>
                <th class="w100">文章摘要</th>
                <td>
                    <textarea name="digest">{$oldArc.digest}</textarea>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">缩略图</th>
                <td>
                     <input type="file" name="thumb" id="" />
                     <div class="slt">
                        <if value="{$oldArc.thumb} eq 'http://localhost/cms/'">
                            暂无缩略图
                        <else>
                            <span class="close">X</span>
                            <img src="{$oldArc.thumb}" width="200" class="shanchu" aid="{$oldArc.aid}" />
                        </if>
                    </div>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章属性</th>
                <td>
                    <label class="checkbox-inline">
                        热门
                        <input type="checkbox" value="热门" name="attr[]" class="check_input" <if value="in_array('热门',{$oldArc.attr})">checked="checked"</if>>
                    </label>
                    <label class="checkbox-inline">
                        置顶
                        <input type="checkbox" value="置顶" name="attr[]" class="check_input" <if value="in_array('置顶',{$oldArc.attr})">checked="checked"</if>>
                    </label>
                    <label class="checkbox-inline">
                        推荐
                        <input type="checkbox" value="推荐" name="attr[]" class="check_input" <if value="in_array('推荐',{$oldArc.attr})">checked="checked"</if>>
                    </label>
                    <label class="checkbox-inline">
                        图文
                        <input type="checkbox" value="图文" name="attr[]" class="check_input" <if value="in_array('图文',{$oldArc.attr})">checked="checked"</if>>
                    </label>
                </td>
                <td></td>
            </tr>
            <tr>
                <th class="w100">文章标签</th>
                <td>
                    <foreach from="$tag" value="$v">
                    <label class="checkbox-inline">
                        {$v.tagname}
                        <input type="checkbox" value="{$v.tid}" name="tag[]" class="check_input" <if value='in_array({$v["tid"]},{$tempTag})'>checked="checked"</if>>
                    </label>
                    </foreach>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章关键字</th>
                <td>
                    <textarea name="keywords" id="" rows="10">{$oldData.keywords}</textarea>
                    <span id="hd_keywors"></span>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章描述</th>
                <td>
                    <textarea name="description" id="" cols="30" rows="10">{$oldData.description}</textarea>
                    <span id="hd_description"></span>
                </td>
                <td></td>
            </tr>
             <tr>
                <th class="w100">文章正文</th>
                <td>
                    <ueditor  width='800' height='300' name='content' content="{$oldData.content}"/> 
                </td>
                <td class="yz_con"></td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
            <tr>
                <th class="w100"></th>
                <td></td>
                <td></td>
            </tr>
        
        </table>
        <div class="position-bottom">
            <input type="hidden" name="aid" value="{$hd.get.aid}"/>
            <input type="submit" class="hd-success" value="修改"/>
        </div>
    </form>
</div>
</body>
</html>